ABC116 C - Grand Garden
提出
code:python
n = int(input())
h = list(map(int, input().split()))
ans = 0
for i in range(n):
解答
code: python
n = int(input())
h = list(map(int, input().split()))
ans = 0
while(True):
if (max(h) == 0):
break
i = 0
while (i < n):
i += 1
else:
# 区間の始まり
ans += 1
while (i < n and hi > 0): # 区間の終わりまで一気に
i += 1
print(ans)
メモ